How can I create a nested dictionary where first dictionary's values act as second dictionary's keys